import http from '../utils/request.js';

export function JiaruGouwucheRequset(proid) {
  let FrontToken = localStorage.getItem('mallFrontToken');
  let FrontUserId = localStorage.getItem('mallFrontUserId');
  return http({
    url: '/api/cart/add',
    method: 'post',
    data: {
      userid: FrontUserId,
      proid,
    },
    headers: {
      token: FrontToken,
    },
  });
}
export function ChakanGouwucheRequset() {
  let FrontToken = localStorage.getItem('mallFrontToken');
  let FrontUserId = localStorage.getItem('mallFrontUserId');
  return http({
    url: '/api/cart/list',
    method: 'post',
    data: {
      userid: FrontUserId,
    },
    headers: {
      token: FrontToken,
    },
  });
}
export function ShanchuGouwucheRequset(id) {
  let FrontToken = localStorage.getItem('mallFrontToken');
  return http({
    url: '/api/cart/remove',
    method: 'post',
    data: {
      cartid: id,
    },
    headers: {
      token: FrontToken,
    },
  });
}
